package yygh.hosp.Controller;


import yygh.hospital.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yygh.common.result.Result;
import yygh.hosp.Service.DeparmentService;

import java.util.List;

@RestController
@RequestMapping("/admin/hosp/department")
public class DeparmentController {

    @Autowired
    DeparmentService deparmentService;

    //排班管理接口1：根据医院编号获取所有的科室信息（大科室+小科室树形结构展示）
    @ApiOperation("根据医院编号获取所有的科室信息（大科室+小科室树形结构展示）")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo>  departmentVo=deparmentService.findDeptTree(hoscode);
        return  Result.ok(departmentVo);
    }

}
